<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			div {
				position: absolute;
				left: 0;
				top: 0;
				width: 200px;
				height: 200px;
				background: pink;
				transform: translate(-50%,-50%);
			}
		</style>
	</head>
	<body>
		<div></div>
		<script type="text/javascript">
			var div = document.querySelector("div");
			window.addEventListener("mousemove",function(e){
				
				div.style.top = e.pageY + "px";
				div.style.left = e.pageX + "px";
			})
		</script>
	</body>
</html>
